Skip to content

Conversation

gwangmu
Copy link
Contributor

@gwangmu gwangmu commented Aug 21, 2025

Resolves: VCUE-1014

As specifying "--environment" as an "#SBATCH" option has caused many nonsensical problems, the container team decided to add an explicit warning (alongside some mitigations to known errors). To avoid distraction, the warning message was kept short in the main usage page ("Using container engine") and linked to the main warning message ("Known issues").

@gwangmu gwangmu marked this pull request as draft August 21, 2025 14:23
Copy link

preview available: https://docs.tds.cscs.ch/237

...
```

As the use of `--environment` as an `#SBATCH` option is reserved for highly customized workflows, users should have a high level of proficiency and a full understanding of the risk to encounter cryptic behaviors. Should users encounter a problem while using `--environment` as `#SBATCH`, it's recommended to move `--environment` from `#SBATCH` to each `srun` and see if the problem disappears.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also mention a benefit of only using --environment as an argument to srun: if you have more than one srun command in the batch script, you can easily use different containers for the different commands.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at the added usage example below

Copy link

preview available: https://docs.tds.cscs.ch/237

1 similar comment
Copy link

preview available: https://docs.tds.cscs.ch/237

@gwangmu
Copy link
Contributor Author

gwangmu commented Aug 25, 2025

For the benefit of the revision, let me briefly summarize the revision items suggested by people.

  • @bcumming Introducing the benefit of --environment on srun: using different containers on a single SBATCH script.
  • @fcruzcscs Add some more details on "the execution environment is not the host system" (via Slack, Link)
  • @fcruzcscs Move up the conclusion and the suggestion, as people may not read up to that far. (via Slack, Link)

Thanks for all the comments, as always, but I need to figure out how to fit these suggestions into this PR because it's currently focused on the warning part; it can easily look awkward if we're talking about benefits and suggestions when the title is "why we discourage it."

Copy link

preview available: https://docs.tds.cscs.ch/237

@gwangmu gwangmu marked this pull request as ready for review August 28, 2025 15:39
Copy link

preview available: https://docs.tds.cscs.ch/237

Comment on lines +40 to +55
Multiple Slurm commands may have different EDF environments; this is useful when a single environment is not feasible due to compatibility issues or keep EDF files modular.

!!! example "`srun`s with different EDFs"
```bash
#!/bin/bash
#SBATCH --job-name=edf-example
#SBATCH --time=00:01:00
...
srun --environment=env1 ... # (1)!
...
srun --environment=env2 ... # (2)!
```

1. Assuming `env1.toml` is at `EDF_PATH`. See [EDF search path][ref-ce-edf-search-path] below.
2. Assuming `env2.toml` is at `EDF_PATH`. See [EDF search path][ref-ce-edf-search-path] below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bcumming I added the benefit of using different EDFs here. I decided to put it outside the warning and introduce this as a usage example (in "Using container engine").

@bcumming bcumming added this pull request to the merge queue Aug 29, 2025
Merged via the queue into eth-cscs:main with commit 1cbb3ca Aug 29, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants